//
//  MYXcontentCell.m
//  meiyinxiang
//
//  Created by 陈李飞 on 2017/11/28.
//  Copyright © 2017年 hbjApple. All rights reserved.
//

#import "MYXcontentCell.h"
#import "MYXmypublishModel.h"
@implementation MYXcontentCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
}
-(void)setMYXmypublishMo:(MYXmypublishModel *)MYXmypublishMo{
    _MYXmypublishMo = MYXmypublishMo;
    self.contentLabel.text=MYXmypublishMo.content;
    NSMutableAttributedString * attributedString1 = [[NSMutableAttributedString alloc] initWithString:self.contentLabel.text];
    NSMutableParagraphStyle * paragraphStyle1 = [[NSMutableParagraphStyle alloc] init];
    [paragraphStyle1 setLineSpacing:8];
    [attributedString1 addAttribute:NSParagraphStyleAttributeName value:paragraphStyle1 range:NSMakeRange(0, [self.contentLabel.text length])];
    [self.contentLabel setAttributedText:attributedString1];
    [self.contentLabel sizeToFit];
        NSDate *date = [NSDate dateWithTimeIntervalSince1970:MYXmypublishMo.create_time.integerValue];
    NSString *timeStr= [MYXDateTimeHelper prettyDateWithRefe:date];
    if ([timeStr isEqualToString:@"今天"]||[timeStr isEqualToString:@"昨天"]) {
        self.numLabel.text = timeStr;
        self.yueLabel.hidden = YES;
    }else{
        self.numLabel.text = [timeStr componentsSeparatedByString:@"月"][0];
        self.yueLabel.hidden = NO;
    }
    
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
